home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
gnused.zip
/
GNUSED
/
MAKEFILE
< prev
next >
Wrap
Text File
|
1992-11-08
|
3KB
|
119 lines
#
# Hacked up Nmake makefile for GNU Sed.
#
# TimF, ArdenW 17-Apr-92
#
# You must have a couple of environment variables set:
#
# BUILD_DEFAULT_TARGETS must be set to one of "-mips" or "-386",
# Build for mips assumes r4000.
#
# INC must ne set the full path to your NT .h files.
#
# LIB must be set to the full path to your NT .lib files.
# (coffbase.txt must be at $(LIB)\..\coffbase.txt
#
#
!IF "$(CPU)" == "i386"
BUILD_DEFAULT_TARGETS=-386
!ENDIF
!IF "$(CPU)" == "MIPS"
BUILD_DEFAULT_TARGETS=-mips
!ENDIF
INC=$(INCLUDE)
!IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
# Set up the compiler flags for building on mips
# I wonder how many of the flags aren't required for anything but building a
# kernel...
CFLAGS = -std -Wb,-dwalign -G 0 -std -checkstack 4096 -excpt -g0 -O -EL \
-c -Wab,-mips2 -Wab,-diag -DMIPS=1 -DNO_EXT_KEYS -DMIPSEL \
-DCONDITION_HANDLING=1 -DNT_INST=0 -DNT_UP=1 -DJAZZ -DR4000
!ELSE
!IF "$(BUILD_DEFAULT_TARGETS)" == "-386"
# Set up the compiler flags for building on x86
CFLAGS = -nologo -Di386=1 -DCONDITION_HANDLING=1 -DNT_UP=1 -DNT_INST=0 \
-DDBG=1 -DDEVL=1 -c -Zel -W4 -H63 -G3d -Ox -Zd
!ELSE
!ERROR You must specify BUILD_DEFAULT_TARGETS as either -386 or -mips.
!ENDIF
!ENDIF
!IFNDEF INC
!ERROR You need to set INC to the NT .h files directory.
!ELSE
INCP = -I. -I$(INC) -I$(INC)\crt
!ENDIF
!IFNDEF LIB
!ERROR You need to set LIB to the NT .lib files directory.
!ENDIF
GENERICFLAGS = -DWINDOWSNT=1 -DSTDC_HEADERS=1
NAME = sed
TARGET= $(BLD)\$(NAME).exe
TLIB = $(BLD)\$(NAME).lib
TOBJ = $(BLD)\$(NAME).obj
BLD = obj
OBJ = $(BLD)\alloca.obj \
$(BLD)\getopt.obj \
$(BLD)\getopt1.obj \
$(BLD)\malloc.obj \
$(BLD)\regex.obj \
$(BLD)\utils.obj
LIBS = $(TLIB) \
$(LIB)\setargv.obj \
$(LIB)\kernel32.lib \
$(LIB)\libc.lib \
$(LIB)\ntdll.lib
!IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
$(TARGET): $(LIBS) $(TOBJ)
@- coff -LINK -out:$(TARGET) -debug:PARTIAL -machine:mips -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
$(TLIB): $(OBJ)
@- coff -lib -out:$(TLIB) $**
.c{$(BLD)}.obj:
@- if not exist $(BLD) md $(BLD) >nul 2>&1
@- chmode -r $@ >nul 2>&1
@- del $@ >nul 2>&1
@- echo cc $<
@- cc $(CFLAGS) $(GENERICFLAGS) $(INCP) -Olimit 1250 -o $@ $<
@- mip2coff $@
!ELSE
$(TARGET): $(LIBS) $(TOBJ)
link -out:$(TARGET) -debug:PARTIAL -machine:i386 -align:0x1000 -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
$(TLIB): $(OBJ)
lib -out:$(TLIB) $**
.c{$(BLD)}.obj:
@- if not exist $(BLD) md $(BLD) >nul 2>&1
@- chmode -r $@ >nul 2>&1
@- del $@ >nul 2>&1
cl386 $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
@- cvtomf $@
!ENDIF